class Hero:
    hero_hp = 0
    hero_power = 0
    hero_name = ""
    def __init__(self):
        print("第一轮游戏开始")
    # 假设游戏只打了一个回合，hp代表血量，power代表攻击力，血量多的获胜
    def fight(self,enemy_hp,enemy_power,enemy_name):
        hero_hp_final = self.hero_hp - enemy_power
        enemy_hp_final = enemy_hp - self.hero_power
        if hero_hp_final > enemy_hp_final:
            print(f"英雄{self.hero_name}获胜,{enemy_name}输了")
        elif hero_hp_final < enemy_hp_final:
            print(f"敌人{enemy_name}获胜，英雄{self.hero_name}输了")
        else:
            print("平局")

# 子类Timo都Jinx都继承了父类Hero，子类重写父类属性
class Timo(Hero):
    hero_hp = 1000
    hero_power = 100
    hero_name = "timo"

class Jinx(Hero):
    hero_hp = 1100
    hero_power = 100
    hero_name = "jinx"


